﻿<Page x:Class="DemoApp.PopupPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      Title="Service"
      x:Name="theView">

    <Popup Name="dialogPopUp" StaysOpen="True" Placement="Center">
        <Border>
            <Border.Background>
                <LinearGradientBrush>
                    <GradientStop Color="Gray" Offset="1"></GradientStop>
                    <GradientStop Color="Silver" Offset="0"></GradientStop>
                </LinearGradientBrush>
            </Border.Background>
            <Grid Margin="5" Background="White">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <ContentControl Grid.Row="0"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            Content="{Binding ElementName=theView, Path=DataContext}" />
                <StackPanel Grid.Row="1"
                            Orientation="Horizontal"
                            HorizontalAlignment="Right">
                    <Button Content="Ok"
                            Click="OK_Click"
                            Margin="5"
                            Width="100"
                            Height="30" />
                    <Button Content="Cancel"
                            IsCancel="True"
                            Click="Cancel_Click"
                            Margin="5"
                            Width="100"
                            Height="30" />
                </StackPanel>
            </Grid>
        </Border>
    </Popup>
</Page>
